/**
 * Copyright 2009 the original author or authors.
 *
 * Licensed under the GPL License, Version 3.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.gnu.org/licenses/lgpl-3.0.txt
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.guardianapis.api.client;

import com.guardianapis.api.domain.Format;


public class TagsRequest {

	/*******************************************************************************
	 * Properties
	 *******************************************************************************/

	private String searchString;
	private Integer count;
	private Integer startPage;
	private Format format;

	/*******************************************************************************
	 * Constructors
	 *******************************************************************************/

	public TagsRequest() {
		this.format = Format.XML;
	}
	
	public TagsRequest(String pSearchString) {
		this();
		this.searchString = pSearchString;
	}

	public TagsRequest(String pSearchString, int pCount, int pStartPage) {
		this();
		this.searchString = pSearchString;
		this.count = pCount;
		this.startPage = pStartPage;
	}

	/*******************************************************************************
	 * Override Object Methods
	 *******************************************************************************/

	/** 
	 * This is the Eclipse generate hashCode method
	 * 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((this.count == null) ? 0 : this.count.hashCode());
		result = prime * result
				+ ((this.format == null) ? 0 : this.format.hashCode());
		result = prime
				* result
				+ ((this.searchString == null) ? 0 : this.searchString
						.hashCode());
		result = prime * result
				+ ((this.startPage == null) ? 0 : this.startPage.hashCode());
		return result;
	}

	/** 
	 * This is the Eclipse generate hashCode method
	 * 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		final TagsRequest other = (TagsRequest) obj;
		if (this.count == null) {
			if (other.count != null)
				return false;
		} else if (!this.count.equals(other.count))
			return false;
		if (this.format == null) {
			if (other.format != null)
				return false;
		} else if (!this.format.equals(other.format))
			return false;
		if (this.searchString == null) {
			if (other.searchString != null)
				return false;
		} else if (!this.searchString.equals(other.searchString))
			return false;
		if (this.startPage == null) {
			if (other.startPage != null)
				return false;
		} else if (!this.startPage.equals(other.startPage))
			return false;
		return true;
	}
	
	/*******************************************************************************
	 * Getters / Setters
	 *******************************************************************************/

	public String getSearchString() {
		return this.searchString;
	}
	
	public void setSearchString(String pSearchString) {
		this.searchString = pSearchString;
	}
	
	public Integer getCount() {
		return this.count;
	}
	
	public void setCount(Integer pCount) {
		this.count = pCount;
	}
	
	public Integer getStartPage() {
		return this.startPage;
	}
	
	public void setStartPage(Integer pStartPage) {
		this.startPage = pStartPage;
	}

	public Format getFormat() {
		return this.format;
	}

	public void setFormat(Format pFormat) {
		this.format = pFormat;
	}
		
}
